﻿#ifndef VERTICALFOLDABLEWIDGET_H
#define VERTICALFOLDABLEWIDGET_H

#include <QWidget>
#include <QSize>

enum FoldDirection{
    FoldLeft = 0,
    FoldRight
};

namespace Ui {
class VerticalFoldableWidget;
}

class VerticalFoldableWidget : public QWidget
{
    Q_OBJECT

public:
    explicit VerticalFoldableWidget(FoldDirection direction = FoldLeft, const QString& title = "", QWidget *parent = nullptr);
    void setTitle(const QString& title);
    //设置成员变量 m_controlWidget 的值
    void setControlWidget(QWidget *controlWidget);
    //设置成员变量 m_parternWidget 的值
    void setParternWidget(QWidget *parternWidget);
    ~VerticalFoldableWidget();

private slots:
    void on_pushButton_clicked();

private:
    Ui::VerticalFoldableWidget *ui;
    //这个是包含它的dockwidget
    QWidget *m_controlWidget = nullptr;
    //这个是与它搭配的dockwidget
    QWidget *m_parternWidget = nullptr;
    //折叠的方向，左边还是在右边
    FoldDirection m_direction;
};

#endif // VERTICALFOLDABLEWIDGET_H
